package com.usian.feign;

import com.usian.pojo.TbUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "usian-sso-service")
public interface SSOFeign {

    /**
     * 更新用户过期时间
     *
     * @param token
     * @return
     */
    @RequestMapping("getUserByToken/{token}")
    public boolean getUserByToken(@PathVariable String token);

    /**
     * 12.注册验证接口
     *
     * @param checkValue
     * @param checkFlag
     * @return
     */
    @RequestMapping("checkUserInfo/{checkValue}/{checkFlag}")
    public boolean checkUserInfo(@PathVariable String checkValue,@PathVariable Integer checkFlag);

    /**
     * 用户注册接口
     *
     * @param tbUser
     * @return
     */
    @RequestMapping("userRegister")
    public Map userRegister(@RequestBody TbUser tbUser);

    /**
     * 用户登录接口
     *
     * @param username
     * @param password
     * @return
     */
    @RequestMapping("userLogin")
    public Map userLogin(@RequestParam String username, @RequestParam String password);

    /**
     * 用户退出接口
     *
     * @param token
     * @return
     */
    @RequestMapping("logOut")
    public boolean logOut(@RequestParam String token);

}
